cmake_minimum_required(VERSION 3.10)

project(M300)

set(CMAKE_CXX_STANDARD 14)

# 可执行文件目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/bin)
# 设置静态库文件目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib)
# 动态库文件目录
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/share)

# copy files
file( GLOB DATA_FILES ./data/*)
foreach(file_i ${DATA_FILES})
file(COPY "${file_i}" DESTINATION "${CMAKE_BINARY_DIR}/out/data")
endforeach( file_i )

file( GLOB LIB_FILES ./lib/*)
foreach(file_i ${LIB_FILES})
file(COPY "${file_i}" DESTINATION "${CMAKE_BINARY_DIR}/out/bin")
endforeach( file_i )

if(WIN32)
    MESSAGE(STATUS "Now in windows")   

else()
    MESSAGE(STATUS "Now in UNIX-like OS's.")

    #默认RPATH设置（linux环境下）
    set(CMAKE_SKIP_BUILD_RPATH FALSE)
    set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
    set(CMAKE_INSTALL_RPATH "")
    set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
endif(WIN32)

#for Qtproject
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

set(DEBUG ON)

add_subdirectory(src)
